<html>
<head><meta charset="utf-8"><title>array by-value iterator stabilization · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html">array by-value iterator stabilization</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="221049743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221049743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221049743">(Dec 28 2020 at 09:43)</a>:</h4>
<p>Hello <span class="user-group-mention" data-user-group-id="2645">@T-libs</span>. With <code>min_const_generics</code> now stable, do you have thoughts on what do to about <a href="https://github.com/rust-lang/rust/pull/65819#issuecomment-751648891"><code>impl IntoIterator for [T; N]</code> regressions</a> or/and about whether to stabilize <a href="https://github.com/rust-lang/rust/issues/65798#issuecomment-751650783"><code>array::IntoIter::new</code></a>?</p>



<a name="221058921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221058921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221058921">(Dec 28 2020 at 13:00)</a>:</h4>
<p>We discussed that a couple weeks ago, and I think were generally on board with stabilizing the explicit constructor minimally to make by-value iteration possible</p>



<a name="221058943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221058943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221058943">(Dec 28 2020 at 13:00)</a>:</h4>
<p>I wonder if we could play some shenanigans with editions to fix the regressions? Might be magical thinking though</p>



<a name="221061525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221061525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221061525">(Dec 28 2020 at 13:47)</a>:</h4>
<p>Not readily, though the compiler could do it in theory. I'd rather just have a iter_owned method on arrays or something like that though.</p>



<a name="221064400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221064400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221064400">(Dec 28 2020 at 14:32)</a>:</h4>
<p>Alright, so it’s either:</p>



<a name="221064466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221064466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221064466">(Dec 28 2020 at 14:33)</a>:</h4>
<ul>
<li>An <code>iter_owned</code> inherent methods on arrays, which is nice because it doesn’t need to be imported</li>
<li>Or a <code>new</code> constructor on the iterator type, which avoid the need to come up with a name that break the usual naming conventions</li>
</ul>



<a name="221064530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221064530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221064530">(Dec 28 2020 at 14:34)</a>:</h4>
<p>Unless… can we have an <code>into_iter</code> inherent method and still have a trait method of the same name later, if they have the same signature?</p>



<a name="221064688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221064688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221064688">(Dec 28 2020 at 14:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="219747">Simon Sapin</span> <a href="#narrow/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization/near/221064530">said</a>:</p>
<blockquote>
<p>Unless… can we have an <code>into_iter</code> inherent method and still have a trait method of the same name later, if they have the same signature?</p>
</blockquote>
<p>we theoretically can afaik, though i would prefer us to use a different name so that we can just forget about the added method once <code>IntoIterator</code> is implemented. Having a method named <code>into_iter</code> for arrays but not for <code>Vec</code> is probably confusing</p>



<a name="221065019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221065019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221065019">(Dec 28 2020 at 14:42)</a>:</h4>
<p>We can't have inherent into_iter without breaking code AFAIK</p>



<a name="221065322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221065322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221065322">(Dec 28 2020 at 14:47)</a>:</h4>
<p>ah, yeah <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span> that's the reason why we don't insta stabilize <code>IntoIter</code> <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="221116093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221116093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221116093">(Dec 29 2020 at 06:59)</a>:</h4>
<p>I like stabilizing the <code>IntoIter::new</code> method.  That's a totally reasonable API to exist (even if eventually deprecated later) and conveniently is over on a type that people will rarely look at once the <code>IntoIterator</code> finally happens.  Needing the import is unfortunate, but I think the goal here is to unblock people which it does fine, and it'd be nice to avoid a vestigial method on the array type (at which people will actually commonly look).  Especially to avoid any confusion about "Why isn't there <code>iter_owned</code> on a <code>Vec</code>?  Can I not get an owning iterator to the items in a vector?"</p>
<p>(I continue to think that once the warning about <code>.into_iter()</code> has been on stable for a release or two we should just add the <code>IntoIterator</code> impl, since it's clearly the desired end-state and this is exactly the kind of change that's why the RFC decided this was an allowed breakage.  Fixing it is a strict code improvement <em>and</em> backwards compatible to Rust 1.0.0.  But obviously it's also good to not break people, so crawling forward is fine for now.)</p>



<a name="221116359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221116359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221116359">(Dec 29 2020 at 07:06)</a>:</h4>
<p>Re <code>IntoIter::new</code>, sounds good!</p>



<a name="221116438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221116438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221116438">(Dec 29 2020 at 07:08)</a>:</h4>
<p>I agree we’ll likely add the <code>IntoIterator</code> impl at some point, it’s just a question of timing. <a href="https://github.com/rust-lang/rust/pull/65819#issuecomment-681132206">https://github.com/rust-lang/rust/pull/65819#issuecomment-681132206</a> mentions work in Cargo to show the relevant warning in dependencies which would help reduce regressions further before we make the change, and looks like there is progress in <a href="https://github.com/rust-lang/cargo/pull/8825">https://github.com/rust-lang/cargo/pull/8825</a></p>



<a name="221125205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221125205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221125205">(Dec 29 2020 at 10:33)</a>:</h4>
<p>Well, so one plausible alternative is to just stabilize an ArrayVec type which is likely to have From array impl</p>



<a name="221125248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221125248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221125248">(Dec 29 2020 at 10:34)</a>:</h4>
<p>But I'd love to see progress here somehow</p>



<a name="221641310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221641310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Kalbertodt <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221641310">(Jan 05 2021 at 12:37)</a>:</h4>
<p><span class="user-mention" data-user-id="125270">@scottmcm</span> "the warning about <code>.into_iter()</code>" -&gt; if you're talking about the lint, that's already on stable since 2020-01-31. But as mentioned already, the cargo change to show these lint warnings for dependencies as well will be helping a lot.</p>



<a name="221641479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221641479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Kalbertodt <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221641479">(Jan 05 2021 at 12:39)</a>:</h4>
<p>My rough plan would be to wait for <a href="https://github.com/rust-lang/cargo/pull/8825">https://github.com/rust-lang/cargo/pull/8825</a> to land and be on stable for a couple release cycles. By then, I would think that everyone had enough time to fix their code or fix/update their dependencies.</p>



<a name="221681864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221681864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221681864">(Jan 05 2021 at 18:18)</a>:</h4>
<p>What do we want to do about <code>Box&lt;[T; N]&gt;</code>? The <code>array_into_iter</code> lint already warns about this, since a method call like <code>.into_iter()</code> can move out of the box, but I don't actually think that's what we would want to happen. i.e. There should be an iterator that moves items out of the box piecemeal, or just let it use <code>vec::IntoIter</code>.</p>



<a name="221681924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221681924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221681924">(Jan 05 2021 at 18:18)</a>:</h4>
<p>Similarly, <code>Box&lt;[T]&gt;</code> could have a consuming iterator (or use <code>vec::IntoIter</code>), but there's no warning about <code>into_iter()</code> on this yet</p>



<a name="221683344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221683344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221683344">(Jan 05 2021 at 18:30)</a>:</h4>
<p><code>Box&lt;[T]&gt;</code> giving a <code>vec::IntoIter</code> seems pretty reasonable -- nothing jumps to mind where the Box version could be better-optimized.</p>



<a name="221687610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221687610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221687610">(Jan 05 2021 at 19:05)</a>:</h4>
<p>I'm fairly sure you can't peacemeal iterate-move out of <code>Box&lt;[T; N]&gt;</code> because it would totally mess with the allocator. You'd have to transform to Vec first</p>



<a name="221687874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221687874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221687874">(Jan 05 2021 at 19:07)</a>:</h4>
<p>the allocator has no notion of T's, there shouldn't be any problem there</p>



<a name="221688080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221688080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221688080">(Jan 05 2021 at 19:09)</a>:</h4>
<p><span class="user-mention" data-user-id="224471">@Lokathor</span> To the allocator, a Vec&lt;T&gt; with a capacity of N should look the exact same as a Box&lt;[T; N]&gt;, no?</p>



<a name="221689403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221689403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221689403">(Jan 05 2021 at 19:20)</a>:</h4>
<p>So what happens when you've done one iteration and stop? The drop for Box will try to drop the content, but then you'd drop on an uninit array element.</p>
<p>I guess you can consume the box, leak it internally, and then carefully muck all the memory yourself after that.</p>



<a name="221689612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221689612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221689612">(Jan 05 2021 at 19:22)</a>:</h4>
<p>yes, that's what into_iter does; it consumes.</p>



<a name="221689651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221689651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221689651">(Jan 05 2021 at 19:22)</a>:</h4>
<p>so you'd use the exact same strategy as vec::IntoIter uses, or just literally re-use that type</p>



<a name="221691405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221691405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221691405">(Jan 05 2021 at 19:38)</a>:</h4>
<p>Yeah, <code>Box&lt;[T; N]&gt;</code> → <code>Box&lt;[T]&gt;</code> → <code>Vec&lt;T&gt;</code> should all be O(1), and iterate like that.  Vec's intoiter is left+right+cap+ptr, all of which are needed for a moving iterator on <code>Box&lt;[T; N]&gt;</code> too.</p>



<a name="221694145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/221694145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#221694145">(Jan 05 2021 at 20:00)</a>:</h4>
<p>I guess for the immediate topic, stabilizing <code>array::IntoIter</code> doesn't need to worry about <code>Box</code>. I just want to make sure we also consider this angle if/when we finally plan for <code>IntoIterator</code>, that <code>Box</code> is in the same boat. It's not <em>as</em> important as arrays, since one can manually do that  transformation to<code>Vec&lt;T&gt;</code> just fine, but it would be nice to have direct <code>IntoIterator</code> there too.</p>



<a name="224646681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224646681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Kalbertodt <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224646681">(Jan 31 2021 at 14:13)</a>:</h4>
<p>Now that <code>min_const_generic</code> and <code>array::IntoIter[::new}</code> have been stabilized, do you think it would be a good time for t-libs to discuss the <code>IntoIterator</code> impl PR and maybe write an official comment on how to proceed? If I am not mistaken, there no "t-libs statement" on the PR thread so far (lots of comments by members of t-libs, but nothing official yet). I feel like the PR is somewhat in limbo right now. I guess it would be useful for everyone to know the plan forward and t-lib's thoughts on the matter. What do you think? :)</p>



<a name="224658692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224658692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224658692">(Jan 31 2021 at 18:50)</a>:</h4>
<p>Looks like still no progress on <a href="https://github.com/rust-lang/cargo/pull/8825">https://github.com/rust-lang/cargo/pull/8825</a>? <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span> </p>
<p>That's the last I heard about what was needed: <a href="#narrow/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization/near/221116438">https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization/near/221116438</a></p>



<a name="224802190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224802190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224802190">(Feb 01 2021 at 22:25)</a>:</h4>
<blockquote>
<p>Yeah, Box&lt;[T; N]&gt; → Box&lt;[T]&gt; → Vec&lt;T&gt; should all be O(1)</p>
</blockquote>
<p>I think that's wrong <code>[T; N]</code> is smaller than <code>[T]</code> due to the length field.</p>



<a name="224802353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224802353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Connor Horman <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224802353">(Feb 01 2021 at 22:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="330154">The 8472</span> <a href="#narrow/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization/near/224802190">said</a>:</p>
<blockquote>
<blockquote>
<p>Yeah, Box&lt;[T; N]&gt; → Box&lt;[T]&gt; → Vec&lt;T&gt; should all be O(1)</p>
</blockquote>
<p>I think that's wrong <code>[T; N]</code> is smaller than <code>[T]</code> due to the length field.</p>
</blockquote>
<p>It would still be O(1), Unsizing is constant time.</p>



<a name="224802562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224802562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224802562">(Feb 01 2021 at 22:28)</a>:</h4>
<p>the first conversion adds a length field, the second conversion adds a capacity field. but those are just usizes that can easily be inlined/optimized away.</p>



<a name="224804870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224804870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224804870">(Feb 01 2021 at 22:48)</a>:</h4>
<p>I see, I think I misunderstood box layout for DSTs.</p>



<a name="224822252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array%20by-value%20iterator%20stabilization/near/224822252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array.20by-value.20iterator.20stabilization.html#224822252">(Feb 02 2021 at 02:44)</a>:</h4>
<p>DSTs carry their extra info in the "fat" pointer, not with the data.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>